<?require_once("connection.php");
  //error_reporting(0);
  $query1 = "select post_title, guid from wp_posts order by id desc limit 1;";
  $result1 = mysql_query($query1);
  $row1 = mysql_fetch_array($result1);

  $course_id = $_POST["course_id"];
  $exercise_id = $_POST["exercise_id"];
  $query = "update g_exercises set solution='".$row1["guid"]."' where exercise_id=".$exercise_id.";";
  $result = mysql_query($query);

  if(empty($result)){
      echo "<pre>The slide has not been UPLOADED!!!</pre>";
  }
  else{
      echo "<pre>The slide has been successfully UPLOADED</pre>";
  }
  require_once("display_exercises.php");
?>
